package com.yizhubao.app.holders;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.yizhubao.app.R;
import com.yizhubao.app.beans.NormalSwipeBean;

/**
 * @author Pacy.
 * Date: 2021/6/6/006
 * Time: 16:18
 * Mail pengwwe457621023@qq.com
 * Info
 */
public class NormalSwipeHolder implements Holder<NormalSwipeBean> {
    TextView title;
    TextView content;
    ImageView icon;
    @Override
    public View createView(Context context) {
        View view= LayoutInflater.from(context).inflate(R.layout.normal_swipe_item,null);
        title=view.findViewById(R.id.title);
        content=view.findViewById(R.id.content);
        icon=view.findViewById(R.id.icon);
        return view;
    }

    @Override
    public void UpdateUI(Context context, int position, NormalSwipeBean data) {
        title.setText(data.getTitle());
        content.setText(data.getContent());
        icon.setImageResource(data.getIcon());
    }
}
